Skip to content

[ar-autolabel-followup] Document video Auto Label in the SDK and CLI - #585

Merged
digaobarbosa merged 4 commits into
mainfrom
digao/video-autolabel
Nov 24, 2026
Merged

digaobarbosa merged 4 commits into
mainfrom
digao/video-autolabel

Conversation

@digaobarbosa

@digaobarbosa digaobarbosa commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

You can now find out from the SDK docstrings and the CLI help how to Auto Label a batch of videos in an action-recognition project, and how to read the job's video progress.

On the backend PR's ephemeral environment, at commit 455fde8, a video job started from the SDK and one started from the CLI both reached done:

Field SDK job CLI job
status done (62 s) done (64 s)
modelType / mediaType video-segment / video video-segment / video
sampling {sampleFps: 1, windowSeconds: 120, overlapSeconds: 15} same
framesPlanned / framesSampled 10 / 10 9 / 9
videos 1 done, 2 segments 1 done, 1 segment

The backend now starts video Auto Label through the same endpoint as image Auto Label. The SDK already sent such a request without changes, but nothing told you so. The model list does not include the video model, and every docstring and help text said "images". A person or an agent reading them had no way to learn the model name, the ontology direction or the frame-rate option.

The docstrings, the autolabel start help, the CLI quickstart and the changelog now describe the video request: the video-segment model, one action description per existing class, and {"sampleFps": n}. The job status docs list the video progress fields. The client adds no new option and no new check: the server stays the only judge of what a video request may contain.

Depends on: roboflow/roboflow#19988. Video Auto Label works only after that backend change is deployed. Before that, the server answers UNSUPPORTED_PROJECT_TYPE.

Type of Change

  • Documentation update

Testing

  • I have tested this change locally
  • I have added/updated tests for this change

Test details:

  • New test: autolabel start -m video-segment --ontology ... --model-options '{"sampleFps": 2}' sends a body with only batchId, modelType, ontology and modelOptions. It locks that no client-side catalog check blocks the video model and that no image-only field leaks into the body.
  • python -m unittest: 1282 tests OK, 1 skipped (Python 3.14, Linux). ruff format, ruff check and mypy roboflow pass.
  • E2E, 6/6 pass. The SDK and CLI ran from this branch at 455fde8, with API_URL=https://pr-19988-api.eph.roboflow.one (backend head d5f01d12d5c). Each job used a new batch with one freshly uploaded video, on an action-recognition project in the staging workspace.
    1. SDK project.autolabel(batch, model="video-segment", ontology={"a car or a person moves across the frame": "moving"}, model_options={"sampleFps": 1}) returns jobId and annotationJobId.
    2. SDK workspace.autolabel_job(jobId) polled to done in 62 s, with every video field. project.autolabel_job(jobId) returns the same payload.
    3. CLI roboflow autolabel start -p <project> --batch-id <batch> -m video-segment --ontology '...' --model-options '{"sampleFps": 1}' exits 0 with a jobId.
    4. CLI roboflow autolabel job <jobId> polled to done in 64 s.
    5. CLI start with --existing-annotations preserve prints the server's {"error": {"message": "Video Auto Label replaces existing segments"}} on stderr and exits 1.
    6. roboflow autolabel start --help shows the video-segment and sampleFps help.
  • Final head ccce3b9 changes only docstrings, help text and the changelog since 455fde8. On it, the help output, the step 5 refusal and an autolabel job read were run again against the same environment, and all pass.
Final SDK job status (excerpt)
{
  "status": "done",
  "modelType": "video-segment",
  "projectType": "action-recognition",
  "mediaType": "video",
  "classes": [{"name": "moving", "description": "a car or a person moves across the frame"}],
  "sampling": {"sampleFps": 1, "windowSeconds": 120, "overlapSeconds": 15},
  "framesPlanned": 10,
  "framesSampled": 10,
  "numImages": 1,
  "videos": {
    "uwxhr2PZyQWCVaNjwGeG": {
      "status": "done", "windows": 1, "segments": 2, "framesSeen": 10,
      "preserved": false, "truncated": false, "windowsFailed": 0, "unanalysedIntervals": []
    }
  }
}

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary, particularly in hard-to-understand areas
  • My changes generate no new warnings or errors
  • I have updated the documentation accordingly (if applicable)

…and CLI

Project.autolabel, Workspace.autolabel_job, the rfapi helpers and the
'autolabel start' help now describe model="video-segment", the
{description: class} ontology, model_options={"sampleFps": n} and the
video progress fields. A CLI test locks the video request body so no
client-side catalog check blocks it.
@digaobarbosa
digaobarbosa marked this pull request as ready for review November 23, 2026 22:10

@joaomarcoscrs joaomarcoscrs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@digaobarbosa
digaobarbosa merged commit b0f4aec into main Nov 24, 2026
15 checks passed
This was referenced Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants